﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ECare.BUS.Data;
using ECare.BUS;

namespace ECare.Client.controls
{
    public partial class ucInInfo : UserControl
    {
        public ucInInfo()
        {
            InitializeComponent();
        }

        public SupplyInfo CurrentSupply { get; set; }

        public void LoadInformation()
        {
            this.lblBatchCode.Text = string.Format(this.lblBatchCode.Text,CurrentSupply.supply_code);
            this.lblSupplyCode.Text = string.Format(this.lblSupplyCode.Text,CurrentSupply.supply_code);
            this.lblResourceCode.Text = string.Format(this.lblResourceCode.Text,ResourcesHelper.GetResourceName(CurrentSupply.resource_id));
            this.lblDate.Text = string.Format(this.lblDate.Text, CurrentSupply.supply_date);
            this.lblNumber.Text = string.Format(this.lblNumber.Text,CurrentSupply.supply_number);
            this.lblKG.Text = string.Format(this.lblKG.Text, CurrentSupply.supply_kg);
            this.lblInvalidDate.Text = string.Format(this.lblInvalidDate.Text, CurrentSupply.supply_invalid_time);
            this.lblRemark.Text = string.Format(this.lblRemark.Text, CurrentSupply.supply_remark);

            this.lblOperatorInfo.Text = string.Format(this.lblOperatorInfo.Text,UserInfoHelper.GetUserNameById(CurrentSupply.supply_create_by),CurrentSupply.supply_create_time);
            this.lblUpdateInfo.Text = string.Format(this.lblUpdateInfo.Text,UserInfoHelper.GetUserNameById(CurrentSupply.supply_update_by),CurrentSupply.supply_update_time);
        }

    }
}
